home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / rl / build-bin / pls < prev    next >
Encoding:
Text File  |  2002-06-04  |  1.5 KB  |  75 lines

  1. #!/bin/sh
  2. # pls - package list
  3. # copyright (c) 2000, joseph cheek, joseph@redmondlinux.org
  4. # released under gpl.
  5. # $1: [partial] file to list.  can be with or without pathname.
  6. # ex: pls /opt/redmondLinux/builds/21/myfile
  7. # ex: pls col/install/myfile
  8. # ex: pls myfile
  9. # opts: -q: quiet [don't print status messages]
  10. #    -v: verbose
  11.  
  12. if [ "n$1" = "n-q" ]; then # -q
  13.   QUIET="-q"
  14.   shift
  15. fi
  16.  
  17. if [ "n$1" = "n-v" ]; then # -v
  18.   VERBOSE="-v"
  19.   shift
  20. fi
  21.  
  22. if [ "$#" -ne 1 ]; then # wrong number of args
  23. ( echo `basename $0`: wrong number of arguments given
  24.   echo
  25.   echo usage: `basename $0` \[-q\] package
  26.   echo lists package in redmond linux build system
  27.   echo -q is quiet, ie don\'t print status messages
  28.   echo -v is verbose ) >&2
  29.   exit 1
  30. fi
  31.  
  32.  
  33. # constants and vars
  34.  
  35. RL_ROOT=/opt/redmondlinux
  36. BUILD_NUM_FILE=$RL_ROOT/builds/CURRENT_BUILD
  37. BUILD_NUM=`cat $BUILD_NUM_FILE`
  38.  
  39. BUILD_ROOT=$RL_ROOT/builds/$BUILD_NUM
  40. BUILD_ROOT_LEN=$[ `echo $BUILD_ROOT | wc -c` - 0 ]
  41. # gives len of build_root plus 1
  42.  
  43. unset PATH_NAME
  44.  
  45. FILE_GLOB="$1"
  46.  
  47. # check for the file
  48.  
  49. # PATH_HEADER=`echo $PATH_NAME | cut -b 1-$BUILD_ROOT_LEN`
  50.  
  51. # if [ "$PATH_HEADER" != "$BUILD_ROOT/" ]; then # not in build root
  52. # ( echo `basename $0`: $1 not in build root
  53. #   echo
  54. #   echo usage: `basename $0` \[-q\] file
  55. #   echo lists file in redmond linux build system
  56. #   echo -q is quiet, ie don\'t print status messages
  57. #   echo -v is verbose ) >&2
  58. #   exit 1
  59. # fi
  60.  
  61.  
  62. # perform ls
  63.  
  64. for a in ${BUILD_ROOT}/*; do
  65.   find ${a}/rl -name \*${FILE_GLOB}\*
  66. done
  67.  
  68. exit 0
  69.